package com.netty.tcp;

import com.netty.tcp.nettyService.NettyServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.net.InetSocketAddress;

/**
 * @author hzj
 * @date 2020/12/31 15:25
 */
@Component
public class InStart implements CommandLineRunner {
    @Autowired
    private NettyServer nettyServer;
    @Value("${server.tcpport}")
    private Integer port;
    @Override
    public void run(String... args){
        nettyServer.start(new InetSocketAddress("0.0.0.0", port));
    }
}
